import request from '@/utils/request'

//学生登录
export const studentLoginService = ({ studentId, password }) =>
  request.post('/student/login', { studentId, password })

//学生信息展示
export const studentInfoService = () =>
  request.get(`/student/getByStudent`)

//查询所有教师所授课程
export const teacherCourseService = () =>
  request.get(`/student/getAllCourses`)

//学生查看自己的选课情况
export const studentCourseService = () =>
  request.get(`/student/selectStudentCourse`)

//学生查看自己的总学分
export const studentCreditService = () =>
  request.get(`/student/selectStudentCredit`)

//学生选课
export const studentSelectCourseService = (courseId) =>
  request.put('/student/AddCourse', { courseId })

//学生修改信息
export const studentUpdateService = ({ id, name, gender, age, password, studentId }) =>
  request.put('/student/update', { id, name, gender, age, password, studentId })